typecast (someone) as (something)

Translations
cantonner (quelqu’un) dans le rôle de (quelque chose)
Definitions
To assign a person to a particular role or identity, often based on stereotypes or preconceived notions, rather than their actual abilities or characteristics.